package com.lu.design.pattern.creational.singleton;

public class LazyDoubleCheckSingleton {

    public static volatile LazyDoubleCheckSingleton lazyDoubleCheckSingleton;

    private LazyDoubleCheckSingleton() {
    }

    public static LazyDoubleCheckSingleton getInstance() {
        if (lazyDoubleCheckSingleton == null) {
            synchronized (LazyDoubleCheckSingleton.class) {
                if (lazyDoubleCheckSingleton == null) {
                    lazyDoubleCheckSingleton = new LazyDoubleCheckSingleton();
                }
                return lazyDoubleCheckSingleton;
            }
        }
        return lazyDoubleCheckSingleton;
    }
}
